﻿using System;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
namespace FrameWorkSong
{
    public class ThreePanel : BasePanel
    {
       
        void Start()
        {
            if (canvasGroup == null)
            {
                gameObject.AddComponent<CanvasGroup>();
                canvasGroup = GetComponent<CanvasGroup>();
            }
        }
        public override void OnEnter()
        {
            if (canvasGroup == null)
            {
                gameObject.AddComponent<CanvasGroup>();
                canvasGroup = GetComponent<CanvasGroup>();
            }
            canvasGroup.alpha = 1;
            canvasGroup.blocksRaycasts = true;
        }
        public override void OnExit()
        {
            canvasGroup.alpha = 0;
            canvasGroup.blocksRaycasts = false;
        }
        public override void OnPause()
        {
            canvasGroup.blocksRaycasts = false;
        }
        public override void OnResume()
        {
            canvasGroup.blocksRaycasts = true;
        }
        public void buttenClick(string name)
        {
            UIPanelType uIPanelType = (UIPanelType)Enum.Parse(typeof(UIPanelType), name);
            UIManager.PushPanel(uIPanelType);
        }
    
        public void onCloseButten()
        {
            UIManager.PopPanel();
            
        }
    }
}
